﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace HousingDistribution
{
    public partial class FormDeadlineSet : Form
    {
        public FormDeadlineSet()
        {
            InitializeComponent();
            this.dateTimePicker.Value = HousingDisDeadline.Instance().ReadData();
        }

        private void buttonSetDeadline_Click(object sender, EventArgs e)
        {
            this.buttonSetDeadline.Enabled = false;
            this.buttonClose.Enabled = false;

            //保存分房截止时间
            HousingDisDeadline.Instance().Deadline(this.dateTimePicker.Value);
      
            UpdateServiceLength updator = new UpdateServiceLength(this.dateTimePicker.Value);
            updator.Proc();

            TotalPersonSortInfoUpdator sortInfoUpdator = new TotalPersonSortInfoUpdator();
            sortInfoUpdator.Proc();

            this.Close();
        }

        private void buttonClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
